import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.config.productionTip = false
//全局前置守卫
router.beforeEach((to,from,next)=>{
  console.log('全局前置to===>',to);
  console.log('全局前置from===>',from);
  if(to.name === 'lesson'){
    console.log('课程页面更新中');
    next(false);
  }else{
    next();
  }
})
//后置守卫
// router.afterEach((to,from)=>{
//   console.log('afterEachto==>',to);
//   console.log('afterEachfrom===>',from);
// })

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
